bool hasCycle(struct ListNode* head)
{
    struct ListNode* slow = head;
    struct ListNode* fast = head;
    while (fast && slow)
    {
        slow = slow->next;
        fast = fast->next;
        if (fast)
            fast = fast->next;
        if (fast == slow && fast)
            return true;

    }
    return false;
    // write code here

}